Skip to content

Support apps compiled against Jetpack Compose 1.10#5189

Open
markushi wants to merge 6 commits intomainfrom
markushi/fix/compose-110-api-changes
Open

Support apps compiled against Jetpack Compose 1.10#5189
markushi wants to merge 6 commits intomainfrom
markushi/fix/compose-110-api-changes

Conversation

@markushi
Copy link
Member

@markushi markushi commented Mar 12, 2026

📜 Description

Fixes #5086
Also fixes yet another issue with detecting scroll / click targets within Jetpack Compose.

Starting with Jetpack Compose 1.10, some internal APIs JVM methods dropped the _release() suffix. E.g. the compiler now generates LayoutNode.getChildren$ui() instead of previous LayoutNode.getChildren$ui_release().

This PR wraps those methods and introduces a compat layer - so they work across multiple versions during runtime.

It required some "extra" gradle setup I'm not to happy about (as AGP does not seem to support different class paths per source set like we did for AGP), but it seems to work good enough.

androidx.compose.ui:ui:1.8.1 replay
https://sentry-sdks.sentry.io/explore/replays/82e1fa9ce34e44519d5ad48270ea8428

androidx.compose.ui:ui:1.10.5 replay
https://sentry-sdks.sentry.io/explore/replays/82d57734f9484b94910de015f301d766/

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

@github-actions
Copy link
Contributor

github-actions bot commented Mar 12, 2026

Semver Impact of This PR

None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


Internal Changes 🔧

Deps

  • Update Native SDK to v0.13.2 by github-actions in #5181
  • Bump github/codeql-action from 4.32.4 to 4.32.6 by dependabot in #5170
  • Bump dorny/paths-filter from 3.0.2 to 4.0.1 by dependabot in #5195
  • Bump actions/create-github-app-token from 2.2.1 to 3.0.0 by dependabot in #5196
  • Bump getsentry/craft from 2.23.1 to 2.24.1 by dependabot in #5197
  • Bump reactivecircus/android-emulator-runner from 2.35.0 to 2.37.0 by dependabot in #5194

Other

  • Support apps compiled against Jetpack Compose 1.10 by markushi in #5189

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 12, 2026

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 320.90 ms 344.98 ms 24.08 ms
Size 0 B 0 B 0 B

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
f064536 327.04 ms 405.35 ms 78.31 ms
cf708bd 408.35 ms 458.98 ms 50.63 ms
d15471f 294.13 ms 399.49 ms 105.36 ms
9fbb112 361.43 ms 427.57 ms 66.14 ms
2387c2c 317.04 ms 354.60 ms 37.56 ms
806307f 357.85 ms 424.64 ms 66.79 ms
b193867 331.08 ms 397.06 ms 65.98 ms
dc4cc7a 361.10 ms 439.53 ms 78.43 ms
694d587 379.62 ms 400.80 ms 21.18 ms
17a0955 372.53 ms 446.70 ms 74.17 ms

App size

Revision Plain With Sentry Diff
f064536 1.58 MiB 2.20 MiB 633.90 KiB
cf708bd 1.58 MiB 2.11 MiB 539.71 KiB
d15471f 1.58 MiB 2.13 MiB 559.54 KiB
9fbb112 1.58 MiB 2.11 MiB 539.18 KiB
2387c2c 1.58 MiB 2.13 MiB 559.54 KiB
806307f 1.58 MiB 2.10 MiB 533.42 KiB
b193867 1.58 MiB 2.19 MiB 620.00 KiB
dc4cc7a 1.58 MiB 2.19 MiB 619.28 KiB
694d587 1.58 MiB 2.19 MiB 620.06 KiB
17a0955 1.58 MiB 2.10 MiB 533.20 KiB

Previous results on branch: markushi/fix/compose-110-api-changes

Startup times

Revision Plain With Sentry Diff
a1de9cc 314.30 ms 357.84 ms 43.54 ms
82fc2e8 307.88 ms 311.33 ms 3.45 ms
64b3ffa 299.61 ms 357.85 ms 58.24 ms

App size

Revision Plain With Sentry Diff
a1de9cc 0 B 0 B 0 B
82fc2e8 0 B 0 B 0 B
64b3ffa 0 B 0 B 0 B

@sentry
Copy link

sentry bot commented Mar 12, 2026

Sentry Build Distribution

App Name App ID Version Configuration Install Page
SDK Size io.sentry.tests.size 8.35.0 (1) release Install Build

@markushi markushi marked this pull request as ready for review March 16, 2026 08:29
### Fixes

- Android: Remove the dependency on protobuf-lite for tombstones ([#5157](https://github.com/getsentry/sentry-java/pull/5157))
- Support masking/unmasking and click/scroll detection for Jetpack Compose 1.10+ ([#5189](https://github.com/getsentry/sentry-java/pull/5189))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 🚫 The changelog entry seems to be part of an already released section ## 8.35.0.
    Consider moving the entry to the ## Unreleased section, please.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Click/scroll flags never reset between sibling nodes
    • Added flag resets at the start of each in-bounds node examination to prevent incorrect gesture target detection across siblings.

Create PR

Or push these changes by commenting:

@cursor push 98ce20ca72
Preview (98ce20ca72)
diff --git a/sentry-compose/src/androidMain/kotlin/io/sentry/compose/gestures/ComposeGestureTargetLocator.kt b/sentry-compose/src/androidMain/kotlin/io/sentry/compose/gestures/ComposeGestureTargetLocator.kt
--- a/sentry-compose/src/androidMain/kotlin/io/sentry/compose/gestures/ComposeGestureTargetLocator.kt
+++ b/sentry-compose/src/androidMain/kotlin/io/sentry/compose/gestures/ComposeGestureTargetLocator.kt
@@ -58,6 +58,8 @@
     while (!queue.isEmpty()) {
       val node = queue.poll() ?: continue
       if (node.isPlaced && layoutNodeBoundsContain(rootLayoutNode, node, x, y)) {
+        isClickable = false
+        isScrollable = false
 
         val modifiers = node.getModifierInfo()
         for (index in modifiers.indices) {

This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

// the last known tag when iterating the node tree
var lastKnownTag: String? = null
var isClickable = false
var isScrollable = false
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Click/scroll flags never reset between sibling nodes

Medium Severity

Moving isClickable and isScrollable outside the while loop means they are never reset between nodes. Previously they were reset to false for each in-bounds node. Now, once any node sets isClickable = true, every subsequent in-bounds node with a tag will overwrite targetTag via targetTag = lastKnownTag, even if that node isn't clickable itself. This can cause the wrong element to be reported as the gesture target — e.g., a non-clickable sibling or child that merely has a tag could replace the correct clickable target.

Additional Locations (1)
Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Session replay not working

2 participants